Ext.define('DCApp.view.attach.Panel', {
    extend: 'Ext.panel.Panel',
    alias: 'widget.attachpanel',
    requires: [
         'DCApp.view.attach.ListModel',
	     'Ext.data.*',
	     'Ext.util.*',
	     'Ext.view.View',
	     'Ext.ux.DataView.DragSelector',
	     'Ext.ux.DataView.LabelEditor'
     ],   
     cls: 'images-view',
      scrollable: false,
      layout:'fit',
      header:false,
      viewModel: {
          type: 'attachlist'
      },
      controller: 'attachlist',
      tbar: ['->',{
    	  xtype:'filefield',
    	  listeners:{
    	        afterrender:function(cmp){
    	            cmp.fileInputEl.set({
    	                multiple:'multiple'
    	            });
    	        }
    	    }
      },{
          text: '上传',
          handler: 'onUpload'
      },{
    	  text: '关联',
    	  handler: 'onRel'
      },{
          text: '删除',
          handler: 'onRemove'
      }],
      
     items: {
    	 xtype:'attachview',
         bind: {
             store: '{objs}'
         }
     },
    initComponent: function() {        
    	if(this.config.bind){
    		Ext.apply(this, {
    			items:{
    		    	 xtype:'attachview',
    		         bind: this.config.bind	
    			}
    		});
    	}
        this.callParent(arguments);
    }
});